package top.cardone.template;

import freemarker.core.Environment;
import freemarker.template.TemplateException;
import freemarker.template.TemplateExceptionHandler;

import java.io.Writer;

/**
 * 模板异常处理
 *
 * @author yao hai tao
 */
@lombok.extern.log4j.Log4j2
public class FreemarkerExceptionHandler implements TemplateExceptionHandler {
    @Override
    public void handleTemplateException(final TemplateException te, final Environment env, final Writer out) throws TemplateException {
        log.error(te.getMessage(), te);
    }
}